﻿using ProductCollector;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThemeCupid.FrontEnd.Model;

namespace ThemeCupid.FrontEnd
{
    public partial class MainPage : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ddlSiteName.DataSource = SitesName.GetAllSiteNames();
                ddlSiteName.DataBind();
            }
            GetCategories();
        }
        public IQueryable<Category> GetCategories()
        {
            var db = new ProductContext();
            IQueryable<Category> query = db.Categories;
            return query;
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Response.Redirect("/FrontEnd/SearchResult.aspx?Site=" + ddlSiteName.SelectedValue + "&&Value=" + appendedInputButton.Value);
        }

    }
}